package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 用户会员表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_user_memberships")
public class UserMemberships extends Model<UserMemberships> {

    private static final long serialVersionUID = 1L;

    /**
     * 会员记录唯一标识
     */
    @TableId("membership_id")
    private Long membershipId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 会员等级id
     */
    @TableField("level_id")
    private Long levelId;
    /**
     * 会员有效期开始时间
     */
    @TableField("start_time")
    private Date startTime;
    /**
     * 会员有效期结束时间
     */
    @TableField("end_time")
    private Date endTime;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    public UserMemberships() {
        this.membershipId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getMembershipId() {
        return membershipId;
    }

    public void setMembershipId(Long membershipId) {
        this.membershipId = membershipId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getLevelId() {
        return levelId;
    }

    public void setLevelId(Long levelId) {
        this.levelId = levelId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "UserMemberships{" +
        ", membershipId=" + membershipId +
        ", userId=" + userId +
        ", levelId=" + levelId +
        ", startTime=" + startTime +
        ", endTime=" + endTime +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        "}";
    }
}
